.foxui-switch {
    display: inline-flex;
    align-items: center;
    position: relative;
    font-size: $--font-size-base;
    line-height: $--switch-height;
    height: $--switch-height;
    vertical-align: middle;

    .foxui-switch-input {
        position: absolute;
        width: 0;
        height: 0;
        opacity: 0;
        margin: 0;
    }

    .foxui-switch-core {
        margin: 0;
        display: inline-block;
        position: relative;
        width: $--switch-width;
        height: $--switch-height;
        border: $--border-style-base $--border-width-base $--switch-inactive-border-color;
        outline: none;
        border-radius: $--switch-border-radius;
        box-sizing: border-box;
        background: $--switch-inactive-background-color;
        cursor: pointer;
        transition: $--border-transition-base, $--background-color-transition-base;
        vertical-align: middle;

        &::after {
            content: '';
            position: absolute;
            top: 1px;
            left: 1px;
            border-radius: 100%;
            transition: $--all-transition;
            width: $--switch-core-size;
            height: $--switch-core-size;
            background-color: $--color-white;
        }
    }

    &.is-checked {
        .foxui-switch-core {
            border-color: $--switch-active-border-color;
            background-color: $--switch-active-background-color;

            &::after {
                left: 100%;
                margin-left: -17px;
            }
        }
    }

    &.foxui-color-success {
        &.is-checked {
            .foxui-switch-core {
                border-color: $--switch-active-success-border-color;
                background-color: $--switch-active-success-background-color;
            }
        }
    }

    &.foxui-color-warning {
        &.is-checked {
            .foxui-switch-core {
                border-color: $--color-warning;
                background-color: $--color-warning;
            }
        }
    }

    &.foxui-color-danger {
        &.is-checked {
            .foxui-switch-core {
                border-color: $--color-danger;
                background-color: $--color-danger;
            }
        }
    }

    &.foxui-color-info {
        &.is-checked {
            .foxui-switch-core {
                border-color: $--color-info;
                background-color: $--color-info;
            }
        }
    }

    &.is-disabled {
        .foxui-switch-core {
            cursor: not-allowed;
            border-color: $--switch-inactive-disabled-border-color;
            background: $--switch-inactive-disabled-background-color;
        }

        &.is-checked {
            .foxui-switch-core {
                border-color: $--switch-active-disabled-border-color;
                background-color: $--switch-active-disabled-background-color;
            }
        }

        &.foxui-color-success {
            &.is-checked {
                .foxui-switch-core {
                    border-color: $--switch-active-disabled-success-border-color;
                    background-color: $--switch-active-disabled-success-background-color;
                }
            }
        }

        &.foxui-color-warning {
            &.is-checked {
                .foxui-switch-core {
                    border-color: $--switch-active-disabled-warning-border-color;
                    background-color: $--switch-active-disabled-warning-background-color;
                }
            }
        }

        &.foxui-color-danger {
            &.is-checked {
                .foxui-switch-core {
                    border-color: $--switch-active-disabled-danger-border-color;
                    background-color: $--switch-active-disabled-danger-background-color;
                }
            }
        }

        &.foxui-color-info {
            &.is-checked {
                .foxui-switch-core {
                    border-color: $--switch-active-disabled-info-border-color;
                    background-color: $--switch-active-disabled-info-background-color;
                }
            }
        }
    }
}
